# 2.创建一个列表，长度为10，数据是1-10的随机数。要求去重复。
list1 = []

list_temp = [x for x in range(1, 11)]
import random

# random.shuffle(list_temp)
# print(list_temp)


# print(list1)
# list1 = random.sample(list_temp, 10)

# i = 0
# while i < 10:
#     a = random.randint(1, 10)
#     if a not in list1:
#         list1.append(a)
#         i += 1

# while len(list1) < 10:
#     a = random.randint(1, 10)
#     if a not in list1:
#         list1.append(a)

# set1 = set()
# # print(type(set1))
#
# while len(set1) < 10:
#     a = random.randint(1, 10)
#     set1.add(a)
#     print(set1)
# 
# list1 = list(set1)
# print(list1)
